// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   PNImpl.java

package com.sunwayhorizo.health.hl7.datatypes.common;

import com.sunwayhorizo.health.hl7.common.VersionInfo;
import com.sunwayhorizo.health.hl7.datatypes.ANY;
import com.sunwayhorizo.health.hl7.datatypes.BL;
import com.sunwayhorizo.health.hl7.datatypes.CS;
import com.sunwayhorizo.health.hl7.datatypes.ENXP;
import com.sunwayhorizo.health.hl7.datatypes.IVL_TS;
import com.sunwayhorizo.health.hl7.datatypes.PN;
import com.sunwayhorizo.health.hl7.datatypes.SET_CS;
import com.sunwayhorizo.health.hl7.datatypes.ST;
import com.sunwayhorizo.health.hl7.datatypes.TYPE;

import java.util.Arrays;
import java.util.List;


// Referenced classes of package oracle.apps.ctb.hl7.types.common:
//            ENCommonImpl, ANYImpl, BLImpl, CSImpl, 
//            TYPEImpl

public class PNImpl extends ENCommonImpl
    implements PN
{

    public static final String RCS_ID = "$Header: PNImpl.java 115.20 2005/09/16 09:23:49 amchanda noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: PNImpl.java 115.20 2005/09/16 09:23:49 amchanda noship $", "oracle.apps.ctb.hl7.types.common");
    private static final PN nullNI = new PNImpl(CSImpl.valueOf("NI"));
    private static final PN nullOTH = new PNImpl(CSImpl.valueOf("OTH"));
    private static final PN nullNINF = new PNImpl(CSImpl.valueOf("NINF"));
    private static final PN nullPINF = new PNImpl(CSImpl.valueOf("PINF"));
    private static final PN nullUNK = new PNImpl(CSImpl.valueOf("UNK"));
    private static final PN nullASKU = new PNImpl(CSImpl.valueOf("ASKU"));
    private static final PN nullNAV = new PNImpl(CSImpl.valueOf("NAV"));
    private static final PN nullMSK = new PNImpl(CSImpl.valueOf("MSK"));
    private static final PN nullNA = new PNImpl(CSImpl.valueOf("NA"));
    private static final PN nullNASK = new PNImpl(CSImpl.valueOf("NASK"));

    public static PN valueOf(List list, SET_CS set_cs, IVL_TS ivl_ts)
    {
        return new PNImpl(list, set_cs, ivl_ts);
    }

    public static PN valueOf(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts, ST st)
    {
        return new PNImpl(aenxp, set_cs, ivl_ts, st);
    }

    public static PN valueOf(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts)
    {
        return new PNImpl(aenxp, set_cs, ivl_ts);
    }

    public PNImpl(CS cs)
    {
        super(cs);
    }

    public PNImpl(List list, SET_CS set_cs, IVL_TS ivl_ts)
    {
        super(list, set_cs, ivl_ts);
    }

    public PNImpl(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts, ST st)
    {
        super(Arrays.asList(aenxp), set_cs, ivl_ts, st);
    }

    public PNImpl(ENXP aenxp[], SET_CS set_cs, IVL_TS ivl_ts)
    {
        super(Arrays.asList(aenxp), set_cs, ivl_ts);
    }

    public TYPE dataType()
    {
        return com.sunwayhorizo.health.hl7.datatypes.common.TYPEImpl.PN;
    }

    public BL equal(ANY any)
    {
        if(!(any instanceof PN))
            return BLImpl.FALSE;
        if(isNull().or(any.isNull()).isTrue())
            return BLImpl.FALSE;
        else
            return super.equal(any);
    }

    public int hashCode()
    {
        return super.hashCode();
    }

    public static PN nullPN(CS cs)
    {
        String s = null;
        if(cs == null || cs.literal().stringValue() == null || cs.isNull().isTrue())
            s = "NI";
        else
            s = cs.literal().stringValue();
        if(s.equals("NI"))
            return nullNI;
        if(s.equals("OTH"))
            return nullOTH;
        if(s.equals("NINF"))
            return nullNINF;
        if(s.equals("PINF"))
            return nullPINF;
        if(s.equals("UNK"))
            return nullUNK;
        if(s.equals("ASKU"))
            return nullASKU;
        if(s.equals("NAV"))
            return nullNAV;
        if(s.equals("MSK"))
            return nullMSK;
        if(s.equals("NA"))
            return nullNA;
        if(s.equals("NASK"))
            return nullNASK;
        else
            return nullNI;
    }

}
